home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / BARNET / FREENET / BRODIE / BETA / FREESMTP.ARC / ReadMeNOW!
Text File  |  1997-09-20  |  39KB  |  1,038 lines

  1. !FreeSMTP 1.33
  2. ==============
  3.  
  4. Contents:
  5.     Copyright & Disclaimer
  6.     Important Changes in this Version
  7.     Installation Instructions
  8.     Upgrading from Earlier versions
  9.     Configuration Instructions
  10.         Why does all email get sent to "localhost"
  11.     Operating Advice
  12.         for people with permanent links
  13.         for people with transient dialup links
  14.     Running & Stopping !FreeSMTP
  15.     What to do if you get the error message:
  16.         Loopback interface is not configured/up
  17.         Loopback interface is configured - but not up
  18.     Kicking the sender
  19.     Activity log
  20.     References
  21.     Bug Reporting
  22.     Technical Details
  23.         MX records explained
  24.         Security Considerations
  25.         Ident
  26.     ChangeLog
  27.  
  28.  
  29. **** WARNING: Incorrect configuration can cause you to be in breach
  30. **** of your provider's terms & conditions.  Full details under the
  31. **** configuration section below, in the subsection "forwarder"
  32.  
  33.  
  34.  
  35.  
  36. Copyright & Disclaimer
  37. ----------------------
  38.  
  39. This program is copyright (C) Stewart Brodie, 1996, 1997
  40.  
  41. The author accepts no liability for any damage or loss of any kind incurred,
  42. or allegedly incurred, by the use, or misuse, of this software.  The program
  43. may do its absolute best to ensure that incoming mail is either stored
  44. successfully in the incoming (or outgoing) mail spool appropriately, or that
  45. the sender is informed that the delivery attempt was unsuccessful and should
  46. be retried (or not as appropriate).
  47.  
  48. Having said all that, I do want people to use it and find any problems.  I'm
  49. afraid that some people's attitude make all those disclaimers necessary.  For
  50. normal usage, there shouldn't be any problem, and the programs try very hard
  51. indeed to prevent any loss occurring (eg. by not acknowledging successful
  52. reception of an e-mail until it has been successfully stored in the spool
  53. directory completely).  If the program fails, then in the vast majority of
  54. cases the upstream SMTP will have received a rejection from this program
  55. (unrequested connection termination counts as a rejection unless the 250
  56. response to the final '.' of a DATA body is received at the sender).  If the
  57. sender half of this software fails, then it it will construct a failure
  58. message and return that directly to the message originator.
  59.  
  60.  
  61.  
  62. Important Changes in this Version
  63. ---------------------------------
  64.  
  65. Lots more minor changes.
  66.  
  67. This version has a new configuration keyword "vaguemessages" which
  68. gives out less accurate errors when incoming mail has been rejected due
  69. to it matching a killfile entry.  Without this keyword, the error
  70. "550 Sender <address> rejected by local policy" gives too many clues
  71. as to how to get around the system.
  72.  
  73. Large killfiles no longer grab huge chunks of memory.
  74.  
  75. This version uses Syslog instead of separate logfiles of its own.
  76.  
  77. This version uses *SMTPServerTaskWindow to start up the server and client
  78. tasks.  This must be set correctly for FreeSMTP to function.  The !Run file
  79. sets it to "%TaskWindow" which allows it to function correctly even in the
  80. presence of but not-yet-loaded-yet-ness of Zap.
  81.  
  82. The DNS code is centralised so although the SMTP Monitor task now requires
  83. quite a bit more memory, the Server and Sender tasks require correspondingly
  84. less.  Since the Server and Sender sometimes run in parallel this is a big
  85. win.
  86.  
  87.  
  88. Installation Instructions
  89. -------------------------
  90.  
  91. Installation should be fairly simple and trouble free provided these
  92. instructions are followed carefully.  You will NEED Newsbase 0.55 or later
  93. in order for this to work properly - it will not like 0.54.  I have tried
  94. to include as much details as possible, so don't worry about the apparent
  95. length of it.
  96.  
  97. * Copy the Transports directory into the !Newsbase directory to install the
  98. interface programs in Newsbase. (You may find that you have to restart
  99. Newsbase now to get it to recognise the newly present transport).
  100.  
  101. * Copy the !FreeSMTP directory into a directory containing your other
  102. Internet applications, and run it in its new home (it will fail to start
  103. because there is no configuration file, but this step is necessary in
  104. order to reset the system variables to point to the correct directory)
  105.  
  106. * Open the Newsbase Transport Control window, and in the middle portion
  107. of this window, choose "in_smtpd" off the Transport menu.  You should now see
  108. the description "SMTP for FreeNet/Acorn TCP/IP (S.N.Brodie)" or similar.  If
  109. you fail to get this far, then you may have forgotten to restart Newsbase or
  110. to rerun !FreeSMTP.
  111.  
  112. * Switch on the Check arrivals new mail option.
  113.  
  114. * Follows the instructions in the Configuration Instructions below
  115.  
  116. * Ensure you have a DNS resolver configuration file.  If you do not have a
  117. DNS resolver installed on your system, then you will need to get one.  You
  118. can find this out by looking for a file in !Internet.Files (or
  119. !FreeUser.Files or !InetSuite.Internet.Files) called "resconf".  If this is
  120. present, then you have already got the necessary file installed.  The
  121. resolver module is NOT used, but the configuration file it uses IS used by
  122. these programs (FreeNet (by Tom Hughes) comes with InetDB and its
  123. installation instructions; ArcWeb (my program) comes with just the
  124. installation instructions necessary)
  125.  
  126.  
  127. Upgrading from Earlier versions
  128. -------------------------------
  129.  
  130. Reinstall the Transports into !Newsbase.
  131.  
  132. Your mail is received into a different directory than before version 1.14.
  133. This makes it compatible with the KA9Q directory structure.
  134.  
  135. You should read the section on 'noiconbar' in the configuration section as
  136. this is a new command.
  137.  
  138.  
  139. Configuration Instructions
  140. --------------------------
  141.  
  142. There is a single configuration file for !FreeSMTP which is stored
  143. inside the !FreeSMTP directory.  This is deliberately entirely made
  144. up of comments so that the programs will refuse to load before you
  145. have edited the configuration.  You should find that you can skim
  146. through this section, modifying the file as you go.
  147.  
  148. (If !FreeSMTP.smtp-conf does not exist, then either copy it from defaultcnf
  149. in the same directory, or click on Setup in the Newsbase Transport Control
  150. window which will do this for you)
  151.  
  152. The configuration file is a sequence of directives which tell the
  153. software what your machine's real name is, what e-mail domains it
  154. hosts, and which domains it relays mail for (if any).  I have tried
  155. to provide as much flexibility as possible whilst keeping it as
  156. simple as possible for the vast majority of cases (take a look at an
  157. /etc/sendmail.cf file on a UNIX system to see how hairy it can become :-)
  158.  
  159. To edit the configuration file, choose the "in_smptd" transport in the
  160. Newsbase "Transport Control" window.  You should then see the description
  161. message "SMTP for FreeNet/Acorn TCP/IP (S.N.Brodie)".  To set up the Newsbase
  162. bit, ensure that "Check arrivals: new mail" is set; Route outgoing mail is
  163. set, and a smarthost is placed in the gateway box for mail(**).  Also set
  164. in_smtpd as the Def mail route.  Then, you should click on the Setup button
  165. which will open the configuration file in your text editor ready for you
  166. to set your own site details.
  167.  
  168. (**) If you set the gateway to be your own machine, then you MUST have
  169.      an appropriate forwarder line as described below.  The line you
  170.      will need will be "forwarder * provider's-smarthost".
  171.  
  172. Provided you have set up the forwarder lines, you can tell any software
  173. you have to send outgoing mail to 'localhost'.  This will result in it
  174. being sent to the server which will then route it using the rules in
  175. smtp-conf without consulting Newsbase.
  176.  
  177. There are brief comments in the configuration file to remind you what each
  178. section is for, but these are elaborated here.  The order of the sections is
  179. not important, although the order of declarations of the same type IS
  180. important (see below for reasons) For each section I have given the syntax,
  181. an example for a Demon DialUp user with a nodename of 'customer',
  182. (applicable to other static IP single host systems too), an example for a
  183. host on a network handling mail for that network, and my own setup.  If you
  184. are on a dynamic IP system, you may need a script to automatically rewrite
  185. the configuration file if you are going to use FreeSMTP - although it is less
  186. likely that you will be using SMTP for mail reception on a dynamic IP node.
  187.  
  188.  
  189. hostname
  190. ========
  191.  
  192. Syntax:   hostname <Fully Qualified Domain Name (FQDN)>
  193. Demon DU: hostname customer.demon.co.uk
  194. Network:  hostname mail.an.org.uk
  195. My Setup: hostname delenn.ecs.soton.ac.uk
  196.  
  197. This gives the *full* hostname(s) of the machine running this software.
  198. Hosts may have more than one name in some circumstances, and this is
  199. allowed by having multiple hostname lines, although the *first* line
  200. found in the file is the one used to identify the server to remote
  201. hosts when it needs to (eg. when greeting SMTP clients)
  202.  
  203. localdomain
  204. ===========
  205.  
  206. Syntax:   localdomain <Fully Qualified Mail Domain> [<alias name>]
  207. Demon DU: localdomain customer.demon.co.uk
  208. Network:  localdomain an.org.uk
  209. My Setup: localdomain delenn.ecs.soton.ac.uk soton
  210.  
  211. [and in My Setup, <SMTPServer$Aliases>.soton contains the line:
  212. S.N.Brodie snb94r
  213. ]
  214.  
  215. This gives the local *mail* domain(s) handled by the software.  These
  216. mail domains are the things you see after the @ in mail addresses.
  217. When mail arrives, the destination is checked to see if there is any
  218. @ character in it.  If there is NOT, then the value of the *first*
  219. localdomain directive is assumed.  (This is so that the alias and user
  220. list functions can determine which set of aliases to apply)
  221.  
  222. Next, the bit after the @ is compared against each localdomain directive in
  223. turn.  If it matches any one of them, then the domain part is dropped. Next,
  224. if an alias name was specified for that localdomain, then the bit before the
  225. @ is looked up in <SMTPServer$Aliases>.aliasname to see if was a mail alias,
  226. and if so, the mail address is rewritten to match the definition of the
  227. alias.  The format of that file is described below.  You MUST be careful with
  228. that file.
  229.  
  230. Otherwise, the bit before the @ is assumed to be a mailbox in the local
  231. Newsbase. (If no domains match, then it is checked against the forwarders
  232. below).
  233.  
  234. If you wish to have an mailbox name that contains characters illegal in RISC
  235. OS filenames, then you can create an alias to convert it to something else,
  236. like I do in my alias file as shown above.
  237.  
  238. For single dialup hosts, there is likely to be a single setting which
  239. will happen to co-incide with the hostname.  For hosts serving entire
  240. domains, this is less likely. (Note that in My Setup, I accept mail for
  241. an unofficial mail domain - you won't find an MX record in the DNS for
  242. the delenn.ecs.soton.ac.uk mail domain)
  243.  
  244.  
  245. alias file format
  246. =-=-=-=-=-=-=-=-=
  247.  
  248. The format of the file is that the alias appears first on the line, and
  249. the real addresses are specified after it separated by whitespace.  If
  250. you need to use more than one line, then these continuation lines MUST
  251. start with whitespace (otherwise they are considered to be other aliases)
  252.  
  253. Although this might seem like a good way to set up a mailing list, this
  254. is NOT the case, since the original sender will be in the FROM envelope,
  255. so any forwarding errors will go to there and not to some mailing list
  256. software.
  257.  
  258. The purpose of the alias file is for *simple* rewriting and occasional
  259. duplication if you need it.  If you want to run a mailing list, then
  260. use something like !MailList.
  261.  
  262. So in My Setup mentioned above shows that any mail incoming addressed
  263. to S.N.Brodie@delenn.ecs.soton.ac.uk will be sent to snb94r.  This is
  264. useful because you can specify names which might not be acceptable as
  265. usernames to Newsbase.
  266.  
  267.  
  268.  
  269. forwarder
  270. =========
  271.  
  272. Syntax:   forwarder <"*" | F.Q. Mail Domain> <"MX" | smarthost-FQDN>
  273. Demon DU: forwarder * post.demon.co.uk
  274. Network:  forwarder * MX
  275.           forwarder * mail.smarthost.provider.org
  276. My Setup: forwarder ecs.soton.ac.uk MX
  277.           forwarder * dsse.ecs.soton.ac.uk
  278.  
  279.  
  280. This gives mail domains which are to be responded to by the software, but
  281. which are not local to this machine (ie. they need to forwarded on somewhere
  282. else, cf. localdomain).  For the vast majority of people, you will want one
  283. forwarder line (see WARNING below - having such lines may in fact
  284. contravene your provider's terms & conditions of service unless you have
  285. specifically purchased the right to forward mail).
  286.  
  287. The major purpose of the non-* entries here is when you are running FreeSMTP
  288. on the mail gateway for a domain (ie. the MX record for a domain gives
  289. the machine running FreeSMTP as one of the mail exchangers).
  290.  
  291. If there are no forwarder lines, then any mail not destined for local
  292. delivery (ie. it matched one of the localdomain lines) will be rejected when
  293. it is offered by another host (*).
  294.  
  295. If there are forwarder lines, then they are matched in order.  If the first
  296. parameter is "*", then this matches, otherwise the string has to match the
  297. bit after the @ in the destination of an incoming mail exactly.  The second
  298. parameter describes how this forwarding is to be achieved and is either the
  299. string "MX" or the FQDN of a smarthost which will do the job for you.
  300.  
  301. There are two ways of forwarding the mail - MX records, and smarthosts. Using
  302. MX records involves looking up the name of the machines which handle mail for
  303. a given mail domain (see description later in this document) and then sending
  304. the mail directly to one of those machines.  The alternative is to use a
  305. 'smarthost' (such as post.demon.co.uk) which will perform that function on
  306. your behalf (ie. it acts as an intermediate relay for you). The advantage of
  307. using MX records, is that it bypasses your provider's smarthost (less hops to
  308. the destination) and can tolerate the smarthost being down.  When MX lookups
  309. return multiple records, they are tried in turn according to the priorities
  310. specified by the DNS server. [This does seem to work, as I found out when
  311. Demon's punts weren't accepting mail and when the connection attempt to them
  312. timed out, it sent it to relay-1 instead :-) ]
  313.  
  314. (*) 'another host' could actually be your own machine.  For example, I
  315. have ArcWeb's Email configuration set up with a smarthost mail gateway
  316. of "localhost".  This means that ArcWeb will send mail by talking to the
  317. SMTP server process running on my own machine.  Thus, having no forwarder
  318. lines in my configuration would mean that I couldn't send mail that way
  319. and would have to configure a remote smarthost in ArcWeb instead.
  320.  
  321.  
  322. forwarder strategy
  323. -=-=-=-=-=-=-=-=-=
  324.  
  325. The forwarder directives which specify MX records are to be used are
  326. overridden in some circumstances, primarily for performance reasons.
  327.  
  328. If the mail has only a single recipient (or multiple recipients with the same
  329. domain) and forwarder says to use MX records, and those MX records exist,
  330. then this will happen.
  331.  
  332. If the mail has multiple recipients, then any MX directive is overridden and
  333. a smarthost is used instead *if one is defined* (because otherwise the
  334. message would have to be sent separately to each recipient).  [A future
  335. enhancement will be to still use MX records if all the destinations share a
  336. common mail exchanger]
  337.  
  338.  
  339. WARNING: Incorrect configuration of forwarder records could cause you
  340.          to be in breach of the terms & conditions of your account.
  341.          Unless you are authorised to forward mail to hosts other than
  342.          those at your provider's end of your connection, you should
  343.          only have one forwarder line:
  344.          
  345.         forwarder * post.demon.co.uk
  346.     
  347.          (where you have substituted your provider's smarthost for
  348.          post.demon.co.uk if you aren't with Demon Internet)
  349.          
  350.          The author accepts no responsibility or liability for any
  351.          such breaches of terms & conditions, nor for consequences
  352.          arising from action taken by providers against any user of
  353.          this software for such breaches even if the author has been
  354.          advised of the possibility of such breaches.
  355.  
  356.  
  357. acceptfrom
  358. ==========
  359.  
  360. Syntax:   acceptfrom ((<IP address> "/" <significant bits>) | ( FQDN ))
  361. Demon DU: (no acceptfrom lines)
  362. Network:  (no acceptfrom lines)
  363. My Setup: (no acceptfrom lines)
  364.  
  365. ** WARNING: If you use hostnames with this command, then these must be
  366. **          resolvable when the program starts, otherwise the directive
  367. **          will be ignored.
  368.  
  369. This is used to selectively choose which remote hosts you are willing to
  370. accept mail from.  If a host other than one listed attempts to deliver
  371. mail to your machine, then it will be told that it does not have permission
  372. to deliver mail to your machine.  If there are no acceptfrom lines (as in
  373. My Setup) then any host may connect.
  374.  
  375. When specifying an IP address, you may specify the number of significant bits
  376. to be matched (as described in the rejectfrom section below)
  377.  
  378. All addresses that pass the acceptfrom directives (including the case
  379. where there are NO acceptfrom directives) are then validated against
  380. the rejectfrom directives described in the next section.
  381.  
  382. There is little real reason to use this facility unless you are worried about
  383. faked e-mail being sent via your site (and even then, the message is tagged
  384. with the Received line containing the IP address of the sender, allowing you
  385. to trace the source)
  386.  
  387. See also: rejectfrom, killfile
  388.  
  389. rejectfrom
  390. ==========
  391.  
  392. Syntax:   rejectfrom ((<IP address> "/" <significant bits>) | ( FQDN ))
  393. Demon DU: rejectfrom 198.81.0.0/16
  394.           rejectfrom 152.163.172.0/24
  395. Network:  rejectfrom relay.deliverer.hackers.org
  396. My Setup: (no rejectfrom lines)
  397.  
  398. ** WARNING: If you use hostnames with this command, then these must be
  399. **          resolvable when the program starts, otherwise the directive
  400. **          will be ignored.
  401.  
  402. This is used to selectively choose which remote hosts you are NOT willing to
  403. accept mail from.  If a host covered by one of these directives, then it will
  404. be told that it does not have permission to deliver mail to your machine.  If
  405. there are no rejectfrom lines (as in My Setup) then any host may connect
  406. (subject to the acceptfrom conditions).  The Demon DU example describes that
  407. mail from 198.81.xxx.xxx and from 152.163.172.xxx will be rejected (these
  408. are the AOL mail exchangers :-)  I am not suggesting that you do this - just
  409. using it as an example of use.
  410.  
  411. IMPORTANT: You should not reject any of your machine's own IP addresses
  412. (including 127.0.0.1 (localhost)).  See also: acceptfrom, killfile
  413.  
  414. In fact, localhost (127.0.0.1) is treated as a special case and FreeSMTP will
  415. not allow you to use it in a rejectfrom command.
  416.  
  417. There is very little real reason to use this facility unless you have
  418. some hacker trying to send you mail, in which case you can block their
  419. IP address using this facility.
  420.  
  421.  
  422. killfile
  423. ========
  424.  
  425. Syntax:   killfile <Fully Qualified Kill File path name>
  426. Demon DU: killfile smtpserver:killfile
  427. Network:  killfile smtpserver:killfile
  428. My Setup: killfile smtpserver:killfile
  429.  
  430. This is used to kill incoming mail based on the *sender* specified
  431. in the SMTP envelope (ie. the MAIL FROM).  The file named in the
  432. directive is consulted when a new transaction is started and if
  433. the sender matches any entry, the mail is rejected.
  434.  
  435. (You need to restart FreeSMTP after editing the killfile in order for any new
  436. entries to take effect)
  437.  
  438. The kill file format itself is one (wildcardable) address per line.
  439. If the kill file does not exist, nothing is killed.
  440.  
  441. vaguemessages
  442. =============
  443.  
  444. Syntax:   vaguemessages
  445. Demon DU:
  446. Network:  
  447. My Setup:
  448.  
  449. This directive is optional and takes no parameters. This is used to control
  450. the message returned to the sender when the incoming mail is being rejected
  451. due to it matched a killfile entry. If this directive is present, the
  452. response is "550 Mailbox does not exist - sorry".  If it is not, then it
  453. replies "550 Sender <sender's address> rejected by local policy".
  454.  
  455.  
  456. noexpand
  457. ========
  458.  
  459. Syntax:   noexpand
  460. Demon DU:
  461. Network:  noexpand
  462. My Setup:
  463.  
  464. This directive is optional and takes no parameters.  If it is present,
  465. then clients attempting an EXPN on an alias will receive a message
  466. indicating that EXPN has been explicitly disabled by the administrator.
  467.  
  468. If you don't understand the above paragraph, then you don't need this.
  469.  
  470. Normally, you'd only use this to stop people looking up the members of
  471. a mailing list of something like that.  The vast majority of people
  472. do not want this.
  473.  
  474.  
  475. noident
  476. =======
  477.  
  478. Syntax:   noident
  479. Demon DU:
  480. Network:  noident
  481. My Setup:
  482.  
  483. This directive is optional and takes no parameters.  If it is present,
  484. then the server will not attempt an ident request to the client making
  485. the connection.  See "Remote User Authentication" section below for
  486. more details of ident.
  487.  
  488. If you don't understand the above paragraph, then you don't need this.
  489.  
  490. You would only ever disable this feature for efficiency reasons.
  491.  
  492. noiconbar
  493. =========
  494.  
  495. Syntax:   noiconbar
  496. Demon DU: noiconbar
  497. Network:
  498. My Setup:
  499.  
  500. This directive is optional and takes no parameters.  If it is present,
  501. then no icon bar icon will be installed.
  502.  
  503. You would only ever disable this feature to avoid filling your iconbar.
  504. If you have this directive, the only way to stop FreeSMTP is to double-
  505. click on FreeSMTP again.
  506.  
  507.  
  508. maxhops
  509. =======
  510.  
  511. Syntax:   maxhops <maximum hop count>
  512. Demon DU:
  513. Network:
  514. My Setup:
  515.  
  516. This directive is optional and defaults to "maxhops 30".  The numeric
  517. parameter describes the maximum number of servers through which the mail is
  518. allowed to be passed before being returned to the sender as undeliverable. 
  519. Usually, mail will take at most half a dozen hops to get to the recipient. 
  520. If it is up to something more like 30 (the default here), then it is likely
  521. that a mail loop has developed (a set of servers (mis)configured to route
  522. mail for the destination domain to each other, which will just keep
  523. forwarding it back and forth forever and ever).  Once maxhops is exceeded,
  524. this server will not forward it any more, but will construct a delivery
  525. failure message and bounce it back to the sender.
  526.  
  527. Almost certainly, you do not want to override the default.
  528.  
  529.  
  530. maxsessions
  531. ===========
  532.  
  533. Syntax:   maxsessions <+ve integer>
  534. Demon DU: maxsessions 4
  535. Network:  maxsessions 4
  536. My Setup: maxsessions 4
  537.  
  538. This specifies the maximum number of sessions that may be in progress at
  539. any one time.  This is limited by the capability of the C library (and if
  540. you specify a number too large, it will be reduced to the maximum that can
  541. be supported - 4 with the current SharedCLibrary.
  542.  
  543. It is important to have this set to 4 for Demon customers, since Demon
  544. have multiple mail machines which may attempt delivery concurrently.
  545.  
  546.  
  547. Why does all email get sent to "localhost"
  548. ------------------------------------------
  549.  
  550. All e-mail sent by your machine will be sent initially to the server on your
  551. machine.  (tech: the GATE command in the work file will always be set up
  552. to be "GATE VIA:localhost").  This is deliberate, because all the mail
  553. routeing cleverness is stored in the *server* at the moment.  That software
  554. can then make the final destination decision and requeue it for sending out.
  555.  
  556. This will cause an extra Received header to be placed in the outgoing mail,
  557. and will also ensure that missing headers are inserted before the mail
  558. leaves your machine too.  
  559.  
  560. This is not a really peculiar thing to do.  Most UNIX machines I have used
  561. have done this.  It is done to simplify the coding of the mail senders
  562. (and make them smaller!) and to centralise the decision making process and
  563. forwarding rule processing into a single place so that policy changes can be
  564. implemented in one go.
  565.  
  566.  
  567. Operating Advice
  568. ----------------
  569.  
  570. for people with permanent connections
  571. =====================================
  572.  
  573. Run it all the time - that's what I do.  The performance of your machine
  574. should not be affected at all when it is idle.
  575.  
  576.  
  577. for people with transient dialup links
  578. ======================================
  579.  
  580. You really do want to start the TCP/IP stack and !FreeSMTP *before*
  581. connecting to the net.  This is particularly important for Demon users, since
  582. the SMTP server takes around 1 second to start up and read its configurations
  583. files and may not manage to start listening for the incoming connections
  584. before the punts attempt to deliver mail (they fail to do so, and hold on to
  585. it for a while before trying again a bit later).  This causes a slight
  586. problem with dialup lines though unless you are careful.  You *must* start
  587. the TCP/IP stack, but you do NOT need to start up the SLIP/PPP interface (if
  588. you do, your dialler won't be able to access the comms port!).  The relevant
  589. bits that must be deferred until after dialling is complete are the slattach
  590. & ifconfig commands.
  591.  
  592. Beware that this means acceptfrom & rejectfrom directives cannot use
  593. hostnames if you do this (because the DNS server will not be reachable until
  594. the link is up).
  595.  
  596.  
  597. Running & Stopping !FreeSMTP
  598. ----------------------------
  599.  
  600. Run !FreeSMTP by double-clicking on the icon in the directory viewer.
  601. To stop, it double-click on the icon again (or kill SMTP Monitor in
  602. the Task display window) or choose Quit from the icon bar menu if you
  603. haven't disabled the Wimp interface (see "noiconbar" directive above)
  604.  
  605.  
  606. What to do if you get the error message:
  607.     Loopback interface is not configured/up
  608.     Loopback interface is configured - but not up
  609. -----------------------------------------------------
  610.  
  611. These two messages are new in version 1.17.  If you get them, then you
  612. will find that the program will not have started.  FreeSMTP needs the
  613. loopback interface configured.  This should have been done during your
  614. boot sequence, or whenever the TCP/IP networking software was loaded.
  615.  
  616. If you get the latter of the messages (which would be unusual unless
  617. you were fiddling around), then you need to issue the command:
  618. "*ifconfig lo0 up" at the command line or insert this in the networking
  619. startup files.
  620.  
  621. If you get the former, then you need to insert the slightly longer:
  622. "*ifconfig lo0 inet 127.0.0.1 up".
  623.  
  624. Once these commands have been executed, FreeSMTP should load.   If it
  625. still doesn't, then the chances are you that are using an old version of
  626. FreeNet.  Edit !FreeSMTP.!Run and insert the following line:
  627.  
  628. Set SMTPServer$NoSearch 1
  629.  
  630.  
  631. (See also: Why does all email get sent to "localhost")
  632.  
  633.  
  634.  
  635. Kicking the sender
  636. ------------------
  637.  
  638. The sender program (out_smtpd) is automatically launched (by SMTP Monitor)
  639. after in_smtpd has queued a mail in the outgoing queue, or the sendmail
  640. Newsbase transport has queued a mail there.  You can kick it by choosing
  641. "Kick" on the icon bar menu (see "noiconbar" directive) or double-clicking on
  642. !SendSMTP (inside !FreeSMTP).
  643.  
  644. After being loaded, it will wait 30 seconds, then 1 minute, then 2, 4, 8,
  645. then 16 minutes, and thereafter every 30 minutes. This is in addition to the
  646. other times when it is kicked manually or by the server.
  647.  
  648.  
  649. Activity Log
  650. ------------
  651.  
  652. This software contains inbuilt activity logging which it will dump to the
  653. Syslog application. The amount of debugging and which debugging is controlled
  654. by a file called area_log inside !FreeSMTP.  This contains one string per
  655. line containing a case-sensitive string to match against those used in the
  656. code.  (* is used as a wildcard which matches every string).  Examples of
  657. these are:
  658.  
  659.     domain_init
  660.     process_mail
  661.     verify_dest
  662.     
  663. Vital messages are always logged if possible.
  664.  
  665. If you place a line containing just a single * character in this file, then
  666. everything will be logged to this file, this will help provided more details
  667. if you are having problem.  If you send me this file when reporting faults,
  668. then it is more likely that I shall be able to help.  If you do this, then
  669. the log file will grow very quickly.  Only use it when attempting to capture
  670. debug trails for me.
  671.  
  672.  
  673. References
  674. ----------
  675.  
  676. RFC821 - Simple Mail Transfer Protocol
  677.  
  678. RFC1123 - Requirements for Internet Hosts
  679.  
  680. RFC1413 - Identification Protocol
  681.  
  682.  
  683. Bug Reporting
  684. -------------
  685.  
  686. There are bug reporting features built-in to the software.  If you edit
  687. the file !FreeSMTP.area_log and add a new line at the bottom containing
  688. just an asterix (*), then all debugging information will be sent to the
  689. files, and not just the really important ones.  These document some of
  690. the decisions made by the software and will contain justification for
  691. those decisions.
  692.  
  693. Please give as much detail as possible when reporting bugs.  Include the
  694. e-mail message that caused the problem if possible.  NOTE:  If you do not
  695. wish to disclose the identities of the sender/recipient, then please feel
  696. free to overwrite it with something else - use * characters for example -
  697. but please do NOT just remove it.  If you do choose to delete parts of it,
  698. then please only delete the bits before the @ in the address.  You may
  699. also like to remove most of the message body.
  700.  
  701. Bug reports to S.N.Brodie@ecs.soton.ac.uk please
  702.  
  703.  
  704. Technical Details
  705. -----------------
  706.  
  707. I have included this section for those who are interested.  It does not
  708. matter if you do not want to read any more of this document.
  709.  
  710. MX Records Explained
  711. ====================
  712.  
  713. Briefly.  You are probably familiar with the concept of hostnames (eg.
  714. customer.demon.co.uk, www.demon.co.uk, sunsite.doc.ic.ac.uk).  The mappings
  715. between these and the 4 byte numeric IP addresses (eg. 152.78.67.42) are
  716. registered in the Domain Name System's 'A' records (A for address).  Mail
  717. domains look very much like hostnames, and in some cases happen to be the
  718. same, but this is coincidence (but arranged like that because it's easier to
  719. remember :-)   Mail domains are also registered in the Domain Name System,
  720. but they do NOT map to IP addresses, but to 'Mail eXchangers'.  These mail
  721. exchangers are simply the hostnames of machines which handle mail for that
  722. mail domain.  For example, when software is using MX records to send me mail,
  723. it looks up the MX records for 'ecs.soton.ac.uk'.  The response it will get
  724. will be something similar to:
  725.  
  726. ecs.soton.ac.uk. IN MX 5 bright.ecs.soton.ac.uk.
  727. ecs.soton.ac.uk. IN MX 10 landlord.ecs.soton.ac.uk.
  728.  
  729. This indicates that bright.ecs.soton.ac.uk (which when looked up, is found to
  730. have the address 152.78.64.201) is a machine which handles mail for
  731. 'ecs.soton.ac.uk'.  landlord.ecs.soton.ac.uk is also reported as a mail
  732. exchanger (so when bright is down, we can still receive mail), but the lower
  733. number indicates that bright is the preferred exchanger, and landlord the
  734. backup.  If you perform a similar lookup on any Demon customer domain,
  735. usually you will find 4 or 5 records, with varying priorities.  Although it
  736. would appear that lots of DNS lookups are required in order to find the
  737. addresses of these mail exchangers, that is not the case typically, as the
  738. full response from the DNS for the question "ecs.soton.ac.uk IN MX" will be
  739. (if not querying one of our authoritative nameservers in Southampton):
  740.  
  741. Questions:
  742. ecs.soton.ac.uk. IN MX
  743.  
  744. Answers:
  745. ecs.soton.ac.uk. IN MX 5 bright.ecs.soton.ac.uk.
  746. ecs.soton.ac.uk. IN MX 10 landlord.ecs.soton.ac.uk.
  747.  
  748. Additional:
  749. bright.ecs.soton.ac.uk IN A 152.78.64.201
  750. landlord.ecs.soton.ac.uk IN A 152.78.114.230
  751.  
  752. Authority records:
  753. dns0.ecs.soton.ac.uk    inet address = 152.78.64.201
  754. dns1.ecs.soton.ac.uk    inet address = 152.78.114.230
  755. dns0.brad.ac.uk inet address = 143.53.240.2
  756. dns0.brad.ac.uk inet address = 143.53.2.5
  757. dns1.brad.ac.uk inet address = 143.53.238.5
  758.  
  759. ie. since it is assumed that you will probably want the IN A record for
  760. each mail exchanger, the DNS server includes those records in its answer
  761. which you may need.  Since you may not 'trust' the nameserver, it also tells
  762. you machines that are the authoritative DNS servers for the ecs.soton.ac.uk
  763. internet domain.  The auth records show the names of our primary and
  764. secondary DNS servers, plus our offsite authority nameserver (an Internet
  765. requirement) at Bradford.
  766.  
  767.  
  768. Remote host authentication
  769. ==========================
  770.  
  771. When a connection is accepted, the peer IP address is looked up in the DNS.
  772. Since this lookup is initiated immediately, then the lookup is often 
  773. complete before the HELO arrives (and the HELO parameter can thus be
  774. authenticated immediately).  The domain name specified as the parameter to
  775. HELO is used in the Received header which is added by the smtp server to
  776. the incoming message, together with either the IP address of the remote
  777. host, or the name as obtained from the DNS.
  778.  
  779. NOTE: Mail will NOT be rejected if the HELO domain fails to authenticate.
  780. This is RFC-compliant behaviour (it is not allowed to reject on the basis
  781. of the HELO domain).
  782.  
  783.  
  784. Remote user authentication
  785. ==========================
  786.  
  787. When a connection is accepted, then an ident request is sent to the origin
  788. machine requesting the user identity of the sender.  (This is not done if
  789. the configuration file contains a "noident" directive).  This is logged
  790. with area "ident" (so place "ident" in area_log to see it)
  791.  
  792. NOTE: You cannot rely on this, particularly on the user id returned. See
  793. RFC1413 for more details about the (lack of) confidence that you should
  794. have in the ident response.
  795.  
  796. NOTE 2: You might decide to disable this, but usually only because the
  797. overhead of establishing a TCP connection to the client wastes resources.
  798. The bandwidth used is negligible though (on average about 10 bytes out,
  799. and 25-50 bytes back).
  800.  
  801.  
  802. Attacks & Security Considerations
  803. =================================
  804.  
  805. Simple denial of service attacks are prevented (limits on number of
  806. recipients for message plus limits on number of concurrent connections)
  807. The recipient limit is set to 100 (minimum requirement in RFC821)
  808.  
  809. Idling attacks are repelled by implementing the timeout strategy given
  810. in RFC1123.
  811.  
  812. Well faked e-mail can never be detected successfully, but the addition
  813. of the Received header to incoming message bodies will assist in the
  814. tracing of injection points into the SMTP system.
  815.  
  816. For the general mail security considerations see RFC821 and RFC1123.  In
  817. the RISC OS environment, a further consideration is that being a single-
  818. user operating system, there is no way to prevent the Newsbase being
  819. examined directly, or the outgoing queue to be examined, unless you have
  820. taken specific measures to make this so.
  821.  
  822. RFC1123 Considerations
  823. ======================
  824.  
  825. Incoming addresses in both MAIL FROM and RCPT TO fields are automatically
  826. rewritten as per RFC1123 to strip unnecessary source routeing from them.
  827. This happens before any other processing.  (This also has the effect of
  828. stopping hackers using source routeing as a way of using you as a mail
  829. gateway, since after the rewrite, the destination domain will no longer
  830. match a localdomain, and will be rejected unless you forward for that
  831. domain)
  832.  
  833. The %-hack is supported by the address rewriter too and explicitly
  834. removed, so hackers can't use that either.
  835.  
  836. Miscellaneous
  837. =============
  838.  
  839. When spooling files if the file cannot be opened in spool.mail.text.user then
  840. spool.fail.user is used instead (and the mail is bounced if that fails too). 
  841. Files in spool.fail.user are never touched again and need to be handled
  842. manually.
  843.  
  844. I am very interested in RFC compliancy issues. E-mail
  845. me any issues you find.
  846.  
  847.  
  848. ChangeLog
  849. =========
  850.  
  851. 1.28
  852. ----
  853.  
  854. Various tweaks to the killfiling system mean that it uses less memory (the
  855. more kills you have the greater the saving) and is less easy for spammers to
  856. diagnose.
  857.  
  858.  
  859. 1.26
  860. ----
  861.  
  862. Status window added.  Syslog used for logging.  Doesn't crash if you disable
  863. the icon bar icon.
  864.  
  865.  
  866. 1.20
  867. ----
  868.  
  869. Forwarding rules code clarified - shouldn't make as many mistakes.
  870.  
  871.  
  872. 1.19
  873. ----
  874.  
  875. Loopback interface is checked for presence and uppishness
  876.  
  877. Low memory situations are handled better.
  878.  
  879. Miscellaneous fixes.
  880.  
  881.  
  882. 1.16
  883. ----
  884.  
  885. The smtp_log left open problem is definitely gone now, because the file is
  886. gone too!  Everything is dumped in mon_log instead.
  887.  
  888. Aliases with capital letters in now work
  889.  
  890. The forwarder doesn't consider you a twat for not using MX records and
  891. constantly override that decision. :-)
  892.  
  893.  
  894. 1.14
  895. ----
  896.  
  897. Local spool directory changed to be spool.mail.text.*
  898.  
  899.  
  900. 1.13
  901. ----
  902.  
  903. Bug in sender fixed - it was treated the successfully connection being made
  904. to the server as an error :-/
  905.  
  906.  
  907. 1.12
  908. ----
  909.  
  910. Full release of the not grabbing all processing time version.  Also
  911. contains a bug fix that cures a misinteraction caused by two concurrent
  912. mail deliveries.  Log file closing finally sorted.  However, because of
  913. the fix, you can't view smtp_log whilst the server is running.
  914.  
  915.  
  916. 1.10
  917. ----
  918.  
  919. Should be better behaved and not grab as much processor time, which should
  920. help people using dialup links
  921.  
  922. 1.09
  923. ----
  924.  
  925. Log file should be closed successfully now
  926.  
  927.  
  928. 1.06
  929. ----
  930.  
  931. Mail can now be sent even without a terminating linefeed.  This would have
  932. caused mail to not be delivered.
  933.  
  934. 1.05
  935. ----
  936.  
  937. DNS Resolver bug fix
  938.  
  939. 1.04
  940. ----
  941.  
  942. RFC compliancy fix: doesn't try the A record if all the MX records fail.
  943. A records only used if no MX records were found.
  944.  
  945. Extra debug information put in to try to determine the cause of some
  946. apparent premature timing out.
  947.  
  948. Activity log notes in this document updated to cover bug reports.
  949.  
  950.  
  951. 1.03
  952. ----
  953.  
  954. VRFY fixed again!  It was rejecting non-local single recipient aliases
  955. because Newsbase was saying that the user was unknown.
  956.  
  957.  
  958. 1.02
  959. ----
  960.  
  961. Fixed domain name processing to not add surplus > characters
  962.  
  963. EXPN procession now works properly again
  964.  
  965.  
  966. 1.01
  967. ----
  968.  
  969. Fixed acceptfrom and rejectfrom handling - the bitfield masks were
  970. the wrong way around 
  971.  
  972.  
  973. 1.00
  974. ----
  975.  
  976. TRACE removed from the sendmail transport!!
  977.  
  978. maxhops added
  979.  
  980. Vital missing headers are added to incoming mail
  981.  
  982.  
  983. 0.11
  984. ----
  985.  
  986. You can disable the GUI by adding 'noiconbar' to the configuration file
  987.  
  988. Some of the log messages are clearer
  989.  
  990. Bug in sendmail transport file corrected
  991.  
  992.  
  993. 0.10
  994. ----
  995.  
  996. Very simple Wimp interface added
  997.  
  998. Some log messages have been changed to make them sound less fatal (some
  999. are purely informational but had alarming sounding overtones)
  1000.  
  1001. in_smtpd's sendmail reads the smtp-conf file to determine how to send
  1002. mail to single recipients, instead of defaulting to MX records (when
  1003. no gateway can be found, and none was given in Newsbase, multiple
  1004. mails are generated to all of the recipients via MX records)
  1005.  
  1006.  
  1007.  
  1008. 0.09
  1009. ----
  1010.  
  1011. Multi-line responses were confusing the SMTP sender because I'd got a
  1012. condition test round the wrong way :-(
  1013.  
  1014. Lock files removed - the task list is scanned instead.
  1015.  
  1016. Long lines were confusing things all over the place.  Although illegal,
  1017. some clients still generate this, so I allow them now too.
  1018.  
  1019. The socket sender had every chance of crashing if a line was to be
  1020. transmitted which was longer than 256 characters!  This is now 
  1021. upped to 1024 characters (something which calling routines already
  1022. enforce)
  1023.  
  1024. SMTP Monitor uses an exponential backoff retry algorithm for sending mail
  1025. when it is first started - it delays 30 seconds, then 1 minute, then 2,
  1026. then 4, then 8, then 16, then every 30 minutes.  It can still be launched
  1027. manually by running !SendSMTP and will be launched whenever you send mail
  1028. locally.
  1029.  
  1030.  
  1031.  
  1032. Please e-mail me any problems: snb94r@ecs.soton.ac.uk
  1033.  
  1034.  
  1035. --
  1036. Stewart Brodie
  1037. September 1997
  1038.